<!DOCTYPE html>
<html lang="zh-CN"><head>
    <title>我的收藏</title>
    <meta charset="utf-8">
    <meta content="" name="description">
    <meta content="" name="keywords">
    <meta content="eric.wu" name="author">
    <meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <link href="http://353556.m.weimob.com/vshop/Assets/css/reset.css" rel="stylesheet">
    <link href="../addons/feng_fightgroups/template/css/myfavorite.css?v=154" rel="stylesheet">
    <script src="../addons/feng_fightgroups/template/js/jquery.min.js" language="javascript"></script>
<body onselectstart="return true;" ondragstart="return false;">
    <div data-role="container" class="container myfavorite">
        <header data-role="header">
        </header>
        <section data-role="body" class="body">
            <ul id="favorite_list" class="favorite_list">
            	{loop $favorite $item}
            	<li>
            		<a href="{php echo $this->createMobileUrl('gooddetails', array('id'=>$item['sid']));}"><span><img src="{php echo tomedia($item['goods']['gimg']);}"></span>
            			<label><span class="table"><div class="line1"><span>{$item['goods']['gname']}</span></div><div class="line2"><span>拼团价：￥{$item['goods']['gprice']}&nbsp;&nbsp;直购价：￥{$goods['oprice']}</span></div></span></label>
            		</a>
            			<label><a onclick="location='{php echo $this->createMobileUrl('orderconfirm',array('groupnum'=>1,'id'=>$goods['id']));}'">直接购买</a><a onclick="location='{php echo $this->createMobileUrl('orderconfirm',array('groupnum'=>$goods['groupnum'],'id'=>$goods['id']));}'">拼团购买</a><a onclick="deleteFav({$item['sid']});">删除</a></label>
            	</li>
            	{/loop}
            	{if empty($favorite)}
            	<li><div style="text-align: center;">您还没有收藏记录哦</div></li>
            	{/if}
            </ul>
        </section>
    </div>
{template 'footerbar'}
</body>
<script>
	function deleteFav(goodsid) {
		$.post('{php echo $this->createMobileUrl('collect',array('op'=>'remove'))}',{goodsid:goodsid},
        function(m){
            if(m==1){
                alert('删除收藏成功！');
                location.reload();
            } else {
                alert('删除收藏失败！');
            }
        },"html");
	}
</script>
</html>